import * as constants from '../Constants'
import { get, GET_RESOLVE_LIST } from '../../service/api'

export interface GetResolveList {
  type: constants.GetResolveList
  payload: Promise<any>
}
export interface GetResolveList_PENDING {
  type: constants.GetResolveList_PENDING
  payload: Promise<any>
}
export interface GetResolveList_FULFILLED {
  type: constants.GetResolveList_FULFILLED
  payload: any
}
export interface GetResolveList_Type {
  type: constants.GetResolveList_Type
  payload: number
}


export type ResolveAction = GetResolveList | 
  GetResolveList_FULFILLED | 
  GetResolveList_PENDING |
  GetResolveList_Type

export function recordType(param: number): GetResolveList_Type {
  return {
    type: constants.GetResolveList_Type,
    payload: param
  }
}

export function getResolveList(param: any): GetResolveList {
  return {
    type: constants.GetResolveList,
    payload: get(GET_RESOLVE_LIST, param)
  }
}